<?php

namespace App\Http\Resources;

//use Illuminate\Http\Resources\Json\ResourceCollection;
use App\Helpers\JsonApiResponseData;
use Illuminate\Http\Resources\Json\JsonResource;
class UserCollection extends JsonResource
{
    use JsonApiResponseData;
    /**
     * Transform the resource collection into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        return [
            'user_id'=>$this->id,
            'openid'=>$this->openid,
            'nick_name'=>$this->name??'',
            'mobile'=>$this->wx_phone??'',
            'avatar'=>$this->avatar??'',
            'create_time'=>strtotime($this->created_at)??'',
        ];
    }


}
